package com.lcx.movie.controller;

import com.lcx.movie.entity.Cinemasnack;
import com.lcx.movie.service.CinemasnackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 李丽君
 * @version 1.0
 * @Description 影院零食控制层
 * @date 2025/3/26 14:08
 */
@RestController
@CrossOrigin(origins = "*")
public class CinemasnackController {
    @Autowired
    private CinemasnackService cinemasnackService;

    /**
     * 新增影院零食
     * @param cinemasnack 影院零食实体
     * @return 消息提示
     */
    @PostMapping("/insertCinemasnack")
    public String insertCinemasnack(@RequestBody Cinemasnack cinemasnack){
        int insertCinemasnack = cinemasnackService.insertCinemasnack(cinemasnack);
        if (insertCinemasnack>0){
            return "Insert Success";
        }else {
            return "Insert Fail";
        }
    }

}
